<?php
/*
 * Administrator Ajax Call File
 * 
 * This file will handle all the Ajax calls from the Admin Controller
 * 
 * @author : Jason Meulenhoff
 * @mail : mail@kacangboi.com
 * @web : http://kacangboi.com
 * @copyright : KacangNetworks 2010
 * 
 */

require '../../config.php';

if(isset($_SESSION['admin']) && isset($_POST['command']) && isLogged())
{
	switch($_POST['command'])
	{
		case "adduser" : 
			adduser($_POST['username'],$_POST['password'],$_POST['email']);
		break;
		
		case "setLanguage" :
			setliveLanguage($_POST['language']);
		break;
		
		case "getLive" :
			echo selectedEnviroment();
		break;
		
		case "getUrl" :
			echo selectedUrl();
		break;
		
		case "getPb" :
			echo selectedPb($_POST['point']);
		break;
		
		case "setPb" :
			echo savePb($_POST['point'],$_POST['value']);
		break;
		
		case "saveUrl" :
			saveUrl($_POST['value']);
		break;
		
		case "clearchat" :
			clearchat();
		break;
		case "disablelive" :
			disableLive($_POST['value']);
		break;
		
		case "getdisable" :
			echo getdisabled();
		break;
		
		default :
			header("Location: ../controllers/error.controller.php");
		break;
	}
}
else
	header("Location: ../controllers/error.controller.php");
	exit;
?>
